<?php
// +----------------------------------------------------------------------
// | 用户管理验证
// +----------------------------------------------------------------------
namespace app\webapp\validate;
use think\Validate;

class Index extends Validate {
	protected $rule = [
		'user_id' => 'require|number',
		//登录
		'username' => 'require',
		'password' => 'require|min:6',
		//修改密码
		'phone' => 'require|number',
		'phone_confirm' => 'require|confirm',
		'oldpassword' => 'require',
		'password_confirm' => 'require|confirm',
		//修改手机号
		'newphone' => 'require|number',
		'newphone_confirm' => 'require|confirm',
		'code' => 'require|number',
		'code_confirm' => 'require|confirm',
	];

	protected $message = [
		'user_id' => '{%lang_user_id}',
		//登录
		'username' => '{%lang_username}',
		'password' => '{%lang_password}',
		//修改密码
		'phone' 		=> '{%lang_phone}',
		'phone_confirm' => '{%lang_phone_confirm}',
		'oldpassword' 	=> '{%lang_oldpassword}',
		'password_confirm'  	=> '{%lang_repassword}',
		//修改手机号
		'newphone' => '{%lang_newphone}',
		'newphone_confirm' => '{%lang_phone_confirm}',
		'code' => '{%lang_code}',
		'code_confirm' => '{%lang_code_confirm}',

	];

	protected $scene = [
		'login'  => ['username','password'],
		'reguser'  	=> ['phone','phone_confirm','username','password','password_confirm','code','code_confirm'],
	];
}
